﻿using System;
using CoreLibrary.Service;

namespace CoreLibrary.Cache {

    public interface ICache : IService {

        T Get<T>(string key);
        T Get<T>(string key, Func<T> itemCreator, bool cacheNewItem);
        T Get<T>(string key, Func<T> itemCreator, TimeSpan expiration, bool cacheNewItem);
        T GetAndEvict<T>(string key);

        void Remove(string key);
        void Put(string key, object value);
        void Put(string key, object value, TimeSpan expiration);

    }

}